package com.atguigu.java;

import org.junit.Test;

import java.util.Date;

public class DateTimeTest {
    @Test
    public void test1(){
        long time = System.currentTimeMillis();
        System.out.println(time);
    }
    @Test
    public void test2(){
        Date date1 = new Date();
        System.out.println(date1);
        System.out.println(date1.toString());
        System.out.println(date1.getTime());
        Date date2 = new Date(1627633171790L);
        System.out.println(date2);
        java.sql.Date date3=new java.sql.Date(1627633171790l);
        System.out.println(date3);
        Date date4=new java.sql.Date(1627633171790l);
        java.sql.Date date5=(java.sql.Date) date4;
        System.out.println(date5);
        Date date = new Date();
        java.sql.Date date7=new java.sql.Date(date.getTime());
    }
}
